/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn2;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 *
 * @author Hiep
 */
public class Bai7 {
    public static void main(String[] args) throws FileNotFoundException, IOException {
        BufferedReader br=new BufferedReader(new FileReader("b7.txt"));
        String s=br.readLine();
        int dem=0;
        StringTokenizer st=new StringTokenizer(s);
        String xau=null;
        while(st.hasMoreTokens()){
            xau=st.nextToken();
            dem++;
        }
        char a[]=st.nextToken().toCharArray();
        int max=0, i, j = 0,n = 0, m = 0, t = 0;
        for( i=0;i<dem;i++){
            if(a[i]!=' '){
                j=i+1;
		t=1;
            }
        }
        while( a[j] !=' ' && j<dem) {
	    t++;
            if(dem>max){
		max=dem;
		n=i;
		m=j;
		}
		j++;
	}
        for(i=n; i<=m; i++){
            System.out.println("phan tu dai nhat là:" +a[i]+ "o vi tri" +m+ "den" +n);
            
        }
    }
    
}
